package io.github.yangyouwang.module.mm.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.github.yangyouwang.module.mm.entity.FutureSymbolCurrentPrice;
import io.github.yangyouwang.module.mm.mapper.FutureSymbolCurrentPriceMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class FutureSymbolCurrentPriceService extends ServiceImpl<FutureSymbolCurrentPriceMapper, FutureSymbolCurrentPrice> {

    @Resource
    private FutureSymbolCurrentPriceMapper futureSymbolCurrentPriceMapper;

    /**
     * 获取某个品种限定时间之前的最大时间的数据
     *
     * @param symbol
     * @param currentDatetime
     * @return
     */
    public FutureSymbolCurrentPrice getByLimitDatetime(String symbol, String currentDatetime) {
        return futureSymbolCurrentPriceMapper.getByLimitDatetime(symbol, currentDatetime);
    }

}
